﻿using Messhall.Domain.Permission.IRepositorys;
using Messhall.Framework.Autofac;
using Messhall.Framework.Domain.UnitOfWork;
using Messhall.Framework.Repository.UnitOfWork;

namespace Messhall.Application.Permission.Commands;

public class CommandHandlerBase
{
    /// <summary>
    /// 工作单元
    /// </summary>
    protected IAppUnitOfWork appUnitOfWork => AutofacBuilder.Resolve<IDbContextUnitOfWork>();

    /// <summary>
    /// 用户仓储接口
    /// </summary>
    protected IUsersRepository usersRepository => AutofacBuilder.Resolve<IUsersRepository>();
    
    /// <summary>
    /// 菜单仓储接口
    /// </summary>
    protected IPermissionRepository permissionRepository => AutofacBuilder.Resolve<IPermissionRepository>();
        
    /// <summary>
    /// 菜单仓储接口
    /// </summary>
    protected IPermissionCodeRepository permissionCodeRepository => AutofacBuilder.Resolve<IPermissionCodeRepository>();
}